/*
    This file is part of libcloak.

    libcloak is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    libcloak is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with libcloak.  If not, see <http://www.gnu.org/licenses/>.

*/



#ifndef CLOAK_RESH
#define CLOAK_RESH

#include <curl/curl.h>
#include <string>

namespace Cloak
{
	using namespace std;
	
	class Resource
	{
		
	protected: 
		bool loaded;
		string name; // Path name of resource
		
		
		Resource();
		Resource(Resource &old);
		
		/**
			Load a resource from the given URL
			
			URLs can start with:<br/>
			file:// (local file)<br/>
			[http|https|ftp]:// (remote file)<br/>
			class:// (class file, not implemented yet)
			
			@param name The URL to load
			@param rlen Pointer to place to store length of buffer
			
		*/
		char *loadResource(const string &name, size_t *rlen);
		
		/**
			Same as the other loadResource, but discards
			length.
			
			@param name The URL to load
			
		*/
		char *loadResource(const string &name);
		
		
		void assertUnloaded();
		
		
		
	public:
		bool isLoaded();
	};
		

}
#endif